﻿using YamlDotNet.RepresentationModel;
using YamlDotNet.Serialization;

namespace AppMachine.Domain.LogicCom.AppComs;

/// <summary>
/// 应用组件配置
/// </summary>
public class ComSwitchExecutorParam {

    public static class Types {

        public class RwControlUnit {
            public RwControlUnit() { }
            public RwControlUnit(string switchRwID,  string ctlMtdName) {
                this.SwitchRwID = switchRwID;
                this.CtlMtdName = ctlMtdName;
            }

            /// <summary>
            /// 应用输出组件ID
            /// </summary>
            public string SwitchRwID { get; set; }
            /// <summary>
            /// 控制方法名称
            /// </summary>
            public string CtlMtdName{ get; set; }
        }

        public class RoDetectUnit {
            public RoDetectUnit() { }
            public RoDetectUnit(string switchRwID,bool isOpen) {
                this.SwitchRoID = switchRwID;
                this.IsOpen = isOpen;
            }
            /// <summary>
            /// 应用输入组件ID
            /// </summary>
            public string SwitchRoID { get; set; }
            public bool IsOpen { get; set; }
        }

    }

    public List<Types.RwControlUnit> RwControlList { get; set; } = [];

    public List<Types.RoDetectUnit> RoDetectList { get; set; } = [];

}
